package vacuum.noxray.math;

/**
 * Represents a three dimensional vector. Immutable. The constructors are O(n) efficiency.
 * @author Ryan Amos
 */
public class Vector {
	private int[] pos;

	public Vector(int x, int y, int z) {
		this.pos = new int[3];
		this.pos[0] = x;
		this.pos[1] = y;
		this.pos[2] = z;
	}
	
	public Vector(int[] pos){
		this.pos = pos.clone();
	}

	public int getX() {
		return pos[0];
	}

	public int getY() {
		return pos[1];
	}

	public int getZ() {
		return pos[2];
	}
	
	public int get(int idx) {
		return this.pos[idx];
	}
	
	public String toString(){
		return getX() + "i + " + getY() + "j + " + getZ() + "k";
	}
	
}
